from django.db import models

# Create your models here.
class Trading(models.Model):
    code = models.CharField(verbose_name="基金编码", max_length=20, null=False)
    date = models.DateField(verbose_name="交易日期", auto_now=False)
    cost = models.FloatField(verbose_name="交易金额")
    units = models.FloatField(verbose_name="交易份额")

    def save(self, *args, **kwargs):
        super().save(*args, **kwargs)
        #SaveTransationDataToFile()
        return

    class Meta:
        verbose_name = "基金交易记录"
        verbose_name_plural = verbose_name